package com.yiqi.lottery.feature.documentary.model;

import com.suozhang.framework.component.http.RxDataProcessFactory;
import com.suozhang.framework.entity.bo.PageData;
import com.yiqi.lottery.entity.bo.HallBo;
import com.yiqi.lottery.feature.documentary.contract.DocumentaryContract;
import com.yiqi.lottery.feature.documentary.dependencies.hall.DaggerDocumentaryModelComponent;
import com.yiqi.lottery.feature.lottery.contract.HallContract;
import com.yiqi.lottery.feature.lottery.dependencies.hall.DaggerHallModelComponent;
import com.yiqi.lottery.framework.api.ApiLib;
import com.yiqi.lottery.framework.api.LotteryApi;
import io.reactivex.Observable;

import javax.inject.Inject;

public class DocumentaryModel implements DocumentaryContract.Model {

    @Inject
    LotteryApi api;

    @Inject
    public DocumentaryModel() {

        DaggerDocumentaryModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }


    @Override
    public Observable<PageData<HallBo>> getHallList(String keyword,int page,Integer bet_type,Integer tab) {
        return api.getDocumenteryDetail(keyword,page,bet_type,tab).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }


}
